package biz.alla.market.service.impl;

import java.util.List;

import biz.alla.market.dao.ApplicationDao;
import biz.alla.market.dao.CategoryDao;
import biz.alla.market.dao.UserDao;
import biz.alla.market.domain.Application;
import biz.alla.market.domain.Category;
import biz.alla.market.domain.User;
import biz.alla.market.service.MarketService;

public class MarketServiceImpl implements MarketService {
    private CategoryDao categoryDao;
    private ApplicationDao applicationDao;
    private UserDao userDao;

    public List<Category> getCategories() {
	return categoryDao.get();
    }

    public List<Application> getApplications(int categoryId) {
	return applicationDao.getApplications(categoryId);
    }

    public List<Application> getApplications(int categoryId, int subCategoryId) {
	return applicationDao.getApplications(categoryId, subCategoryId);
    }

    public Application getApplication(int applicationId) {
	return applicationDao.getApplication(applicationId);
    }

    public User isValidUser(String username, String password) {
	return userDao.isValidUser(username, password);
    }

    public void setCategoryDao(CategoryDao categoryDao) {
	this.categoryDao = categoryDao;
    }

    public void setApplicationDao(ApplicationDao applicationDao) {
	this.applicationDao = applicationDao;
    }

    public void setUserDao(UserDao userDao) {
	this.userDao = userDao;
    }
}
